import { Component, OnInit ,Inject} from '@angular/core';
import {Router, ActivatedRoute, Params} from '@angular/router';
import { Service } from '../../server/server';
declare var $:any;

@Component({
  selector: 'app-sidebar-theme',
  templateUrl: './sidebar-theme.component.html',
  styleUrls: ['./sidebar-theme.component.css']
})
export class SidebarThemeComponent implements OnInit {

  right: any = {
    "root_keyword" : {},
    "systemThemeTag" : {},
    "systemTable":{},
    "systemTableTag" : {}
 };

 taskType:any;

  constructor( public router:Router, private server:Service,private activatedRoute: ActivatedRoute) { 
    this.right = $.extend(this.right, server.getRight());
  }
 
  public isActive= this.server.isActive;
  ngOnInit() {
    this.server.eventEmit.subscribe((value: any) => {
      this.isActive=value;
    });
    this.activatedRoute.queryParams.subscribe((p: Params) => {
			this.taskType = String(p['taskType']);
    });
  }

  public userActive:any;

  ngDoCheck(){
    this.right = $.extend(this.right, this.server.getRight());
  }

  //跳转页面
	onPageClick(type:any){
    this.taskType = type;
    this.router.navigate(['/product/list'],{queryParams:{ taskType:type }}); 
  }

}
